home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine CD 1995 / Archive Magazine CD 1995.iso / discs / prog_disc / volume_1 / issue_09 / debugger / sourcecode / alphabet01
Encoding:
Text File  |  1988-05-01  |  1.5 KB  |  53 lines

  1.  
  2. u0ô > &.SourceCode.Alphabet01
  3. u:'ô Author               : G L Fitton
  4. uD-ô Copyright            : ABABCUS TRAINING
  5. uN)ô Version 1.00         : 1st May 1988
  6. uX:
  7. ub9ô The source code for a simple machine code programme
  8. ul/ô which systematically prints the alphabet.
  9. uv:ô Can be used to demonstrate the BreakPts01 programme.
  10. u€:
  11. u⇩ë 0
  12. u“@Þ dummy% (&10000-¸P-&24)              :ô A dummy byte array.
  13. ufiDÞ code% &200                           :ô Place code% at &10000.
  14. u¨:
  15. u²Aendofcode%=¤_Alphabet01(code%)          :ô Assemble the code.
  16. u¼Cÿ("SAVE &.ObjectCode.Alphabet01 "+Ã~(code%)+" "+Ã~(endofcode%))
  17. uÆ,*SETTYPE    &.ObjectCode.Alphabet01 &FFC
  18. uÐ'*STAMP      &.ObjectCode.Alphabet01
  19. uÚ:
  20. uäñ'
  21. uî*MemoryI 10000 +30
  22. uø:
  23. và
  24. v :
  25. vÝ ¤_Alphabet01(start%)
  26. v %ô Prints the upper case alphabet.
  27. v*ê sp,pass%,print
  28. v4:
  29. v>ô Use the BASIC stack.
  30. vH)sp        = 13     : ô Stack pointer.
  31. vR:
  32. v\ã pass% = 0 ¸ 3 ⇦ 3
  33. vf
  34. P%=start%
  35. vp[OPT pass%
  36. vz1STMFD (sp)!,{R14}  ; Store link on the stack.
  37. v☓*MOV R2,R14         ; Store link in R2.
  38. v‰.MOV R0,#&41        ; The –II code for "A".
  39. v—1MOV R1,#&5B        ; The character after "Z".
  40. v¢/.print             ; A label for BMI print.
  41. v¬/SWI "XOS_WriteC"   ; Print character in R0.
  42. v¶0ADD R0,R0,#1       ; Next character into R0.
  43. vÀ(CMP R0,R1          ; Last character?
  44. vÊ0BMI print          ; If not then goto print.
  45. vÔ$SWI "XOS_NewLine"  ; <LF>, <CR>.
  46. vÞ$SWI "XOS_NewLine"  ; <LF>, <CR>.
  47. vè1ADR R3,start%      ; Address of start% to R3.
  48. vò.LDMFD (sp)!,{PC}   ; Return to BASIC prog.
  49. vü]
  50. w í pass%
  51. w=P%
  52. w:
  53. ÿ